﻿@{
    Layout = null;
}
@model System.Data.DataTable

<!DOCTYPE html>
<html>
<head>
    <title>补贴查询</title>
  @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    
    @Html.DevExpress().GetStyleSheets(
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }

    )
    @Html.DevExpress().GetScripts(
                    new Script { ExtensionType = ExtensionType.ListBox }
    )
   
       <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    <script type="text/javascript">

        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;
            e.customArgs["nsrmc"] = $("#hidnsrmc").val();
            e.customArgs["NSRBM"] = $("#hidNSRBM").val();
            e.customArgs["NSRSBH"] = $("#hidNSRSBH").val();
            e.customArgs["year"] = $("#hidyear").val();
        }

        
        //查询
        function search() {
            $("#hidnsrmc").val(NSRMC.GetText());
            $("#hidNSRBM").val(NSRBM.GetText());
            $("#hidNSRSBH").val(NSRSBH.GetValue());
            $("#hidyear").val(FYear.GetText());
            $("#hsearched").val("T");
            gvEditing.Refresh();
        }


        //重置
        function undo() {
            NSRMC.SetText("");
            NSRBM.SetText("");
            NSRSBH.SetText("");
            FYear.SetText("");

        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnExcel":
                    {
                        if ($("#hsearched").val() == "T") {
                            //if (CheckValues())
                            form_query.target = '_self';
                            form_query.action = rootPath + "/QueryAllowanceWaitList/ExportToXls";
                            form_query.submit();
                        }
                        break;


                    }
                case "btnReport":
                    {
                        if ($("#hsearched").val() == "T") {
                            window.showModalDialog(rootPath + "/QueryAllowanceWaitList/Print", window, "dialogWidth=800px;dialogHeight=500px");
                        }
                        //if (CheckValues())
                        //                        form_query.target = '_blank';
                        //                        //  form_query.target = 'parent.contentframe';
                        //                        //  parent.contentframe.url(
                        //                        form_query.action = rootPath + "/QueryAllowanceWaitList/Print";
                        //                        form_query.submit();
                        break;


                    }
                case "btnGridShow":
                    {
                        gvEditing.ShowCustomizationWindow();
                        break;
                    }
            }
        }
        function keyPress() {
            if (event.keyCode && event.keyCode == 13) {
                search();

            }

        }
    </script>
</head>
<body  onkeypress="keyPress()">
    @using (Html.BeginForm("ExportToXls", "QueryAllowanceWaitList", FormMethod.Post, new { id = "form_query" }))
    {
            @Html.DevExpress().Menu(settings =>
       {
           settings.Name = "toolBarMenu";
           settings.ItemAutoWidth = false;
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
           settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
           settings.Items.Add(item =>
           {
               item.Name = "btnExcel";
               item.Text = "导出Excel";
               item.Image.Url = Url.Content("~/Content/ControlImages/excel.png");
           });
           settings.Items.Add(item =>
           {
               item.Name = "btnReport";
               item.Text = "打印";
               item.Image.Url = Url.Content("~/Content/icons/print.png");
           });

           settings.Items.Add(item =>
           {
               item.Name = "btnGridShow";
               item.Text = "选择列";
               item.Image.Url = Url.Content("~/Content/FunctionImages/AllowanceFileAudit.png");
           });
	
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
           settings.ItemLinkMode = ItemLinkMode.ContentBounds;
       }).GetHtml()
        
    <table class="query"  width="800px" style="margin-left: auto; margin-right: auto" >
        <tr>
            <td align="right" style="text-align:right">
              纳税人编码:
            </td>
            <td>
                 @Html.DevExpress().TextBox(settings =>
            {
                settings.Name = "NSRBM";
                settings.Width = System.Web.UI.WebControls.Unit.Pixel(150);
            }).GetHtml()

            </td>
            <td align="right" style="text-align:right">
                纳税人名称:
            </td>
            <td>
          
                 @Html.DevExpress().TextBox(settings =>
            {
                settings.Name = "NSRMC";
                settings.Width = System.Web.UI.WebControls.Unit.Pixel(147);
            }).GetHtml()
 
            </td>
            <td>
                @Html.DevExpress().Button(settings =>
           {
               settings.Name = "btnSearch";
               settings.Text = "查询";
               settings.ControlStyle.CssClass = "button";
               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
               settings.ClientSideEvents.Click = "search";
           }).GetHtml()
            </td>
            <td>
                @Html.DevExpress().Button(settings =>
           {
               settings.Name = "btnUndo";
               settings.Text = "重置";
               settings.ControlStyle.CssClass = "button";
               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
               settings.ClientSideEvents.Click = "undo";
           }).GetHtml()
            </td>
        </tr>
        <tr>
                    <td align="right" style="text-align:right">
                纳税人识别号:
            </td>
            <td>
           @Html.DevExpress().TextBox(settings =>
      {
          settings.Name = "NSRSBH";
          settings.Width = System.Web.UI.WebControls.Unit.Pixel(150);
      }).GetHtml()

            </td>
                        <td align="right" style="text-align:right">
                补贴年度:
            </td>
            <td>
           @Html.DevExpress().TextBox(settings =>
      {
          settings.Name = "FYear";
          settings.Width = System.Web.UI.WebControls.Unit.Pixel(150);
      }).Bind(ViewData["year"]).GetHtml()

            </td>
           <td align="right" style="text-align:right">
            </td>
            <td>
            </td></tr>
      
    </table>
    @Html.Partial("QueryAllowanceWaitListPartial", Model)
    

        @Html.Hidden("hidnsrmc", "")
        @Html.Hidden("hidNSRBM", "")
        @Html.Hidden("hidNSRSBH", "")
        @Html.Hidden("hidyear", ViewData["year"])

        @Html.Hidden("hsearched", "F")
    }
</body>
</html>
